home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_Binary / Graphic.h < prev    next >
Encoding:
Text File  |  1992-12-19  |  2.9 KB  |  112 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34. *    Graphic.h
  35.  *
  36.  *    Version:    2.0
  37.  *    Author:    Ken Fromm
  38.  *    History:
  39.  *            03-07-91        Added this comment.
  40. */
  41.  
  42. #import "FormatApp.h"
  43. #import "DrawingView.h"
  44. #import <objc/Object.h>
  45. #import <appkit/graphics.h>
  46.  
  47. #define FILL        0
  48. #define STROKE    1
  49. #define CLIP        2
  50.  
  51. #define GRAY    0
  52. #define RGB        1
  53. #define HSB        2
  54. #define CMYK    3
  55.  
  56. typedef struct _GParms {
  57.     unsigned char        path_type;
  58.     unsigned char        color_type;
  59.     float                gray;
  60.     float                red;
  61.     float                green;
  62.     float                blue;
  63.     float                linewidth;
  64.     float                miterlimit;
  65.     unsigned char        linejoin;
  66.     unsigned char        linecap;
  67. } GParms;
  68.  
  69. @interface Graphic : Object
  70. {
  71.     NXRect     bounds;            /* the bounds */
  72.  
  73.     GParms    parms;            /* the graphic state parameters for the object */
  74.  
  75.     UPath    path;            /* the path */
  76. }
  77.  
  78. /* Factory methods */
  79. + new;
  80. - free;
  81.  
  82. - installGparms:(const GParms *) gParms;
  83. - installUpath:(const UPath *) aUpath andBounds:(const NXRect *) aRect;
  84. - getBounds:(NXRect *)theRect;
  85.  
  86. - setPathType:(int) value;
  87. - (int)pathType;
  88.  
  89. - setLineWidth:(float) value;
  90. - (float)lineWidth;
  91. - setLineJoin:(int) value;
  92. - (int)lineJoin;
  93. - setLineCap:(int) value;
  94. - (int)lineCap;
  95. - setMiterLimit:(float) value;
  96. - (float)miterLimit;
  97.  
  98. - (int) colorType;
  99. - setGray:(float)value;
  100. - (float)gray;
  101. - setRGBColor:(int)r  : (int)g  :(int)b;
  102. - getRGBColor:(int *)r  : (int *)g  :(int *)b;
  103. - setHGBColor:(int)h  :(int)s  :(int)b;
  104. - getHGBColor:(int *)h  :(int *)s  :(int *)b;
  105. - setCMYKColor:(int)c  : (int)m :(int)y  :(int)k;
  106. - getCMYKColor:(int *)c  : (int *)m :(int *)y  :(int *)k;
  107.  
  108. - drawObject:(NXRect *) r  currentParms:(GParms *) gParms  withFormat:(int) format;
  109.  
  110. @end
  111.  
  112.